#ifndef CSGAME_H
#define CSGAME_H

class CPokerConnection;
class CStudHand;
class CSavedGame;

#include "CGame.h"
#include "CaribbeanCommon.h"


// kharmon.  09-28-05.  #5861.  Added base class that both Stud and Holdem now derive from.
class CStudGame : public CGame
{
	public:
		CStudGame(CPokerConnection*, int32 bet, int32 progressiveBet);
		CStudGame(CPokerConnection*, CSavedGame*);
		virtual ~CStudGame();

		bool8 deal(int32 balance);
		bool8 raise(int32 balance, uint8 *);
		bool8 fold(int32 balance);

		int32 getBet();

		void send();
		void save(CSavedGame*);

		bool8 isGameOK();

        CStudHand * getPlayerHand() { return player; }
        CStudHand * getDealerHand() { return dealer; }

        int32 getDeckSeed() { return m_nDeckSeed; }     // kharmon.  10-12-06.  #8226.  

        enum PayTableTypes
        {
            CSTUD_PAYFREQ_LOW,
            CSTUD_PAYFREQ_MEDIUM,
            CSTUD_PAYFREQ_HIGH,
            MAX_CSTUD_PAY_FREQUENCIES
        };

        enum ProgressivePayTableTypes
        {
            CSTUD_PROGPAYFREQ_LOW,
            CSTUD_PROGPAYFREQ_MEDIUM,
            CSTUD_PROGPAYFREQ_HIGH,
            CSTUD_PROGPAYFREQ_ALTHIGH1,
            MAX_CSTUD_PROGRESSIVE_PAY_FREQUENCIES
        };


	protected:
		bool8 finish(bool8, int32);

		bool8 calcPayouts(int32*, int32*, int32*, bool8, bool8*, int32*, int32*);

		bool8 restore(CSavedGame*);


	protected:
		CPokerConnection*	conn;
		int32				bet, progressiveBet;
		CStudHand*			dealer;
		CStudHand*			player;
        uint8               payTable, progPayTable;
		bool8				bGameOK;

        int32               m_nDeckSeed;
		//
		// *IMPORTANT*  When adding/changing here, be sure to update
		//				constructors/destructor, send(), save(), restore()
		//
};

inline int32
CStudGame::getBet()
{
	return bet;
}

inline bool8
CStudGame::isGameOK()
{
	return bGameOK;
}

#endif
